package com.boot.core.entity;/**
 * @description
 * @autor xbwu on 2018/5/14.
 */

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

/**
 * mybatis-plus基类实体
 * 增加乐观锁机制字段
 * @author xbwu
 * @create 2018-05-14 
 **/
@Data
public class BaseMpVersionEntity<T extends Model> extends BaseMpEntity<T> {

    /**
     * mp乐观锁注解
     */
    @Version
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "version",type = MySqlTypeConstant.BIGINT,isNull = false)
    protected Long version;

}
